package com.steven.door.receiver;

import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;

public class RestartDeviceReceive extends BroadcastReceiver {
    @SuppressLint("UnsafeProtectedBroadcastReceiver")
    @Override
    public void onReceive(Context context, Intent intent) {
        PackageManager pm = context.getPackageManager();    //包管理者
        Intent it = new Intent();                           //意图
        it = pm.getLaunchIntentForPackage("com.steven.door");   //值为应用的包名
        if (null != it)
        {
            context.startActivity(it);         //启动意图
        }
    }
}
